/**
 * 
 * 
 * 以下代码来自开源代码库 Vuestic UI
 * 
 * https://github.com/epicmaxco/vuestic-ui/blob/develop/packages/ui/src/services/vue-plugin/utils/global-properties.ts
 * 
 * 
 * 
 */
import { App, AppContext } from 'vue'

export const extractGlobalProperties = (app: App | AppContext) => app.config.globalProperties

export const setGlobalProperty = (app: App, key: any, v: any) => { 
    const globalProperties = extractGlobalProperties(app)
    globalProperties[key] = v
}

export const getGlobalProperty = (app: App, key: any) => { 
    return extractGlobalProperties(app)[key]
}